<?php
	require_once 'projekt_st/spletne/PB/OsebaModel.php';
//baza

$streznik = $_SERVER["HTTP_HOST"];  
			
$pot = rtrim(dirname($_SERVER["PHP_SELF"]), "/\\");




session_start();

//nastavitve za sejo

$pb = new PB();
$pb->conn();

$oseba = $pb->login($_POST["upime"], $_POST["geslo"]);
//echo "v prijavi: <br>";

//print_r($oseba);
if(!$oseba) {
	header( "Location: http://".$streznik."".$pot."/index.php?napaka=neuspeh" ); 
} 
else{
	$_SESSION = $oseba;
    header( "Location: http://".$streznik."".$pot."/prva.php" );
} 

?>